import React,{useEffect} from 'react'
import * as action from "../action"
import {useDispatch,useSelector} from "react-redux"
import List from '../components/List'
import Myswiper from '../components/Myswiper'
import Mynotice from '../components/Mynotice'
import Myheader from '../components/Myheader'
function Home() {
  let dispatch = useDispatch()
  let store = useSelector((state)=>{
      return {
          ...state.homereducer
      }
  })
  useEffect(()=>{
      dispatch(action.Boutiquelist())
      dispatch(action.Freedatalist())
    
  },[])
  return (
    <div>
        <Myheader></Myheader>
        <Myswiper></Myswiper>
        <Mynotice></Mynotice>
        {
            store.Boutiquearr &&  store.Boutiquearr.length ? <List lefttit="精品荟萃" righttit="换一换" arr={store.Boutiquearr}></List>:""
        }
        {
            store.freearr && store.freearr.length ? <List lefttit="限时免费" righttit="more" arr={store.freearr}></List>:""
        }
       
    </div>
  )
}

export default Home